package com.google.code.wicket.auth.component.marker;

import java.util.Collection;

import org.apache.wicket.Component;

/**
 * Deals with components by setting
 * {@link Component#setVisibilityAllowed(boolean)} to false.
 * 
 * @param <T>
 *            the privilege type
 */
public class ComponentHideMarker<T> extends MarkerSupport<T> {

    /**
     * Constructor with a privilege type.
     * 
     * @param privilegeType
     */
    public ComponentHideMarker(final Class<T> privilegeType) {
        super(privilegeType);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected boolean doHandleMissingValues(final Component component,
            final Collection<T> missingValues) {
        component.setVisibilityAllowed(false);
        return true;
    }

}
